import { fromEvent, debounceTime, map } from 'rxjs';

export const windowResizingObservable = fromEvent(window, 'resize')
  .pipe(debounceTime(100))
  .pipe(
    map((e) => {
      const body = document.getElementsByTagName('body')[0];
      return { width: body.offsetWidth, height: body.offsetHeight };
    })
  );
